<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Manifest</title>
  <link rel="manifest" href="./manifest.json"> <!-- 引用manifest文件 -->
</head>
<body>
  <h1>Manifest Page</h1>
  <script>
  // 此处代码 后面相关章节会去说明
  if ('serviceWorker' in navigator) {
    window.addEventListener('load', function() {
      navigator.serviceWorker.register('sw.js')
        .then(function(registration) {})
        .catch(function(err) {})
    })
  }
  </script>
</body>
</html>